﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace ScorchedTanks
{
    public enum GameState { Lobby, Playing, Ended }
    class Networking
    {

        public GameState currentGameState = GameState.Lobby;
        public NetworkSession networkSession;
        public PacketWriter writer = new PacketWriter();
        public PacketReader reader = new PacketReader();

        public Networking()
        {

        }

        public void CreateSession() {
            networkSession = NetworkSession.Create(NetworkSessionType.SystemLink, 2, 2);

            networkSession.AllowHostMigration = true;
            networkSession.AllowJoinInProgress = false;
            //log.Add("New session created");
            HookSessionEvents();
        }
        void HookSessionEvents()
        {
        //    log.Add("Listening for session events");
        //    networkSession.GamerJoined += GamerJoinedEventHandler;
        //    networkSession.GamerLeft += GamerLeftEventHandler;
        //    networkSession.HostChanged += HostChangedEventHandler;
        }
    }
}
